package cn.lil.service;

import cn.lil.dao.BearingDao;
import cn.lil.model.Bearing;
import cn.lil.utils.DataSourceUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

public class BearingService {
    private BearingDao bearingDao;

    public BearingService() {
        bearingDao = new BearingDao();
    }

    public void addBearing(Bearing bearing) throws SQLException {
        bearingDao.addBearing(bearing);
    }

    public Bearing selectBearingById(int id) throws SQLException {
        return bearingDao.selectBearingById(id);
    }
    // 可以添加其他服务方法，如获取轴承列表、根据ID获取轴承等
}
